#pragma once
#include "DataSQL.h"
class CUtilSql
{
public:
	static bool connectToServer(const CString &sHost, const CString& sUser, const CString& sPass);
	static bool connectToDatabase();
	static bool createDatabase(MYSQL* pSql,CString sDatabase);
	static bool createTable(CString sDatabase, CString sTable);
	static bool importFromFile(CString sFile);
	static bool insertRecord(int nTable,CString sValue);
	bool updateRecord(CString sQurey);
	bool deleteRecord(CString sQurey);
	static bool getField(int nPosTbl,std::vector<CString> &vtField , std::vector<int> &vtType);
	CString getPrimerKey();
	
	static bool getTableList(vector<CString> &vtTables);
	static bool deleteDatabase(const CString& sDatabase);

	static CString getTableAt(int nPos);
	CString getFielName(const CString& sTable,int nPos);
	CString getFormatFromType(int nType);
public:
	static CString m_sName;
	static std::vector<CString> m_vtTable;

};